package com.gome.ss.core.plugin;

import java.io.IOException;
import java.lang.reflect.InvocationTargetException;

import org.jdom2.JDOMException;

import com.gome.ss.core.schedule.ScheduleManager;

public class SpiderLocalPluginHandle extends SpiderPluginHandle {
	
	private SpiderLocalPluginStepConfig config = null;
	private String pluginQualifiedName = "";
	
	public void loadLocalClazz(SpiderLocalPluginStepConfig config, String pluginName) throws ClassNotFoundException, IllegalArgumentException, IllegalAccessException, InvocationTargetException, SecurityException, NoSuchMethodException, IOException, InstantiationException, JDOMException {
	    this.config = config;
		this.pluginFileName = "Local Plugin";
		this.pluginName = pluginName;
		this.pluginQualified = config.getQualified();
		this.pluginQualifiedName = config.getQualifiedName();
		this.processable = config.getProcessable();
		
        this.pluginClazz = this.pluginClassLoader.loadClass(pluginQualified);
        this.pluginObject = this.pluginClazz.newInstance();
	}

	public SpiderLocalPluginStepConfig getConfig() {
		return config;
	}

	public String getPluginQualifiedName() {
		return pluginQualifiedName;
	}
}
